// pages/personal/combo.js
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        /*项目预测*/
        onceFee: 0,
        monthFee: 0,
        onceTimes: 0,
        monthTimes: 0,
        // 工作事业
        works_once_nums: 0,
        works_month_nums: 0,
        works_oncepay: 0,
        works_monpay: 0,
        // 情感咨询
        emotion_once_nums: 0,
        emotion_month_nums: 0,
        emotion_oncepay: 0,
        emotion_monpay: 0,
        // 公关审核
        pr_once_nums: 0,
        pr_month_nums: 0,
        pr_oncepay: 0,
        pr_monpay: 0,
        // 团体套餐
        group_once_nums: 0,
        group_month_nums: 0,
        group_oncepay: 0,
        group_monpay: 0,
        //学业考研
        stu_once_pay:0,
        stu_month_pay:0,
        stu_once_nums:0,
        stu_month_nums:0,
        theme:'',
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        var cacheUserInfo = wx.getStorageSync('user_phone');
        var that = this;

        wx.request({
            url: app.globalData.domain + 'v3/index/getUserCombo',
            method: 'post',
            data: {
              user_phone: cacheUserInfo.phoneNumber?cacheUserInfo.phoneNumber:'',
            },
            success (res) {
                if (res.data.code == 0) {
                    that.setData({
                        onceTimes: res.data.data.once_nums,
                        monthTimes: res.data.data.month_day,
                        onceFee: res.data.data.oncepay,
                        monthFee: res.data.data.monpay,
                        // 工作事业
                        works_once_nums: res.data.data.works_once_nums,
                        works_month_nums: res.data.data.works_month_nums,
                        works_oncepay: res.data.data.works_oncepay,
                        works_monpay: res.data.data.works_monpay,
                        // 情感咨询
                        emotion_once_nums: res.data.data.emotion_once_nums,
                        emotion_month_nums: res.data.data.emotion_month_nums,
                        emotion_oncepay: res.data.data.emotion_oncepay,
                        emotion_monpay: res.data.data.emotion_monpay,
                        // 公关审核
                        pr_once_nums: res.data.data.pr_once_nums,
                        pr_month_nums: res.data.data.pr_month_nums,
                        pr_oncepay: res.data.data.pr_oncepay,
                        pr_monpay: res.data.data.pr_monpay,
                        // 团体套餐
                        group_once_nums: res.data.data.group_once_nums,
                        group_month_nums: res.data.data.group_month_nums,
                        group_oncepay: res.data.data.group_oncepay,
                        group_monpay: res.data.data.group_monpay,   
                        //学业考研
                        stu_once_pay: res.data.data.stu_once_pay,
                        stu_month_pay:res.data.data.stu_month_pay,
                    });
                }
                console.log('debug::', res);
            }
          })
    },
    onShow(){
        if(wx.getStorageSync('theme') == 'style1'){
            this.setData({
              theme:'style1',
      
            })
        }else{
            this.setData({
              theme:'init',
            })
        }
    }
})